package com.woniuxy.cq.phrase3.dao;


import com.woniuxy.cq.phrase3.controller.form.ChangeUserRoleForm;
import com.woniuxy.cq.phrase3.controller.form.ProjectForm;
import com.woniuxy.cq.phrase3.controller.form.UserForm;
import com.woniuxy.cq.phrase3.entity.Country;
import com.woniuxy.cq.phrase3.entity.Industry;
import com.woniuxy.cq.phrase3.entity.Role;
import com.woniuxy.cq.phrase3.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Lucas
 * @since 2020-09-07
 */
public interface UserMapper {
    User findByName(String username);
    int addUser(UserForm userForm);
    int addJurisdiction(@Param("userId") Integer userId,@Param("roleId") Integer roleId);
    Set<String> findPermsById(Integer id);
    Set<String> findRolesById(Integer id);
    String findRolesByUserId(Integer id);
    int addProject(ProjectForm projectForm);
    List<Industry> getAllIndustry();
    List<Country> getAllCountry();
    int deleteUserById(Integer userId);
    int updateUserByUserForm(UserForm userForm);
    List<UserForm> queryAllByPage(UserForm userForm);
    List<Role> getAllRole();
    void changeRole(ChangeUserRoleForm changeUserRoleForm);
    int deleteUserRoleByUserId(Integer userId);

    int updateuserOfficeIdBychangeUserRoleForm(@Param("userId")Integer userId,@Param("userOfficeId") Integer UserOfficeId);
}
